/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.tor.tribes.types;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Torridity
 */
@Entity
@Table(name = "ReportUnits")
public class ZebraReportUnit implements Comparable<ZebraReportUnit> {

    @Override
    public int compareTo(ZebraReportUnit o) {
        return getUnit().getId().compareTo(o.getUnit().getId());
    }

    public enum TYPE {

        ATTACKER, LOST_ATTACKERS, DEFENDER, LOST_DEFENDERS, OUTSIDE, ON_THE_WAY
    }
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @OneToOne(cascade = CascadeType.ALL)
    private ZebraReport report;
    @OneToOne
    private DSUnit unit;
    @Enumerated(EnumType.STRING)
    private TYPE type;
    private int amount;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setType(TYPE type) {
        this.type = type;
    }

    public TYPE getType() {
        return type;
    }

    public void setReport(ZebraReport report) {
        this.report = report;
    }

    public ZebraReport getReport() {
        return report;
    }

    public void setUnit(DSUnit unit) {
        this.unit = unit;
    }

    public DSUnit getUnit() {
        return unit;
    }

    public void setAmount(int amount) {
        this.amount = amount;
    }

    public int getAmount() {
        return amount;
    }
}
